10000 receipts are available on table. Each receipt represents a transaction with items that were purchased. The receipt is a representation of stuff that went into a customer’s basket. That is exactly what the Groceries Data Set contains: a collection of receipts with each line representing 1 receipt and the items purchased. Each line is called a transaction and each column in a row represents an item.
Perform Market Basket analysis and look at association rules to understand what goods can be bundled and what types of promotions or discounts can be offered on the products either online or at the retail store.
Load required libraries.
library(tidyverse)
## -- Attaching packages ------------------------------------------------------------ tidyverse 1.3.0 --
## v ggplot2 3.2.1 v purrr 0.3.3
## v tibble 2.1.3 v dplyr 0.8.3
## v tidyr 1.0.0 v stringr 1.4.0
## v readr 1.3.1 v forcats 0.4.0
## -- Conflicts --------------------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(knitr)
library(ggplot2)
library(lubridate)
##
## Attaching package: 'lubridate'
## The following object is masked from 'package:base':
##
## date
library(arules)
## Loading required package: Matrix
##
## Attaching package: 'Matrix'
## The following objects are masked from 'package:tidyr':
##
## expand, pack, unpack
##
## Attaching package: 'arules'
## The following object is masked from 'package:dplyr':
##
## recode
## The following objects are masked from 'package:base':
##
## abbreviate, write
library(arulesViz)
## Loading required package: grid
## Registered S3 method overwritten by 'seriation':
## method from
## reorder.hclust gclus
library(plyr)
## ------------------------------------------------------------------------------
## You have loaded plyr after dplyr - this is likely to cause problems.
## If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
## library(plyr); library(dplyr)
## ------------------------------------------------------------------------------
##
## Attaching package: 'plyr'
## The following object is masked from 'package:lubridate':
##
## here
## The following objects are masked from 'package:dplyr':
##
## arrange, count, desc, failwith, id, mutate, rename, summarise,
## summarize
## The following object is masked from 'package:purrr':
##
## compact
library(RColorBrewer)
Set working directory.
setwd("D:/SivaBulusu/MarkeBasketAnalysis")
getwd()
## [1] "D:/SivaBulusu/MarkeBasketAnalysis"
Check the data format of input provided. The input data is a transaction file. The data is in the desired format to proceed with our analysis.
Read transaction file and view summary.
groceryTransactions <- read.transactions('groceries.csv', format = 'basket', sep=',')
summary(groceryTransactions)
## transactions as itemMatrix in sparse format with
## 9835 rows (elements/itemsets/transactions) and
## 169 columns (items) and a density of 0.02609146
##
## most frequent items:
## whole milk other vegetables rolls/buns soda
## 2513 1903 1809 1715
## yogurt (Other)
## 1372 34055
##
## element (itemset/transaction) length distribution:
## sizes
## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
## 2159 1643 1299 1005 855 645 545 438 350 246 182 117 78 77 55 46
## 17 18 19 20 21 22 23 24 26 27 28 29 32
## 29 14 14 9 11 4 6 1 1 1 1 3 1
##
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.000 2.000 3.000 4.409 6.000 32.000
##
## includes extended item information - examples:
## labels
## 1 abrasive cleaner
## 2 artif. sweetener
## 3 baby cosmetics
There are 9835 transactions. Top 5 items bought frequently by customers as per summary are whole milk, other vegetables, rolls/buns, soda and yogurt.
Create an item frequency plots for the top 20 items.
itemFrequencyPlot(groceryTransactions,topN=20,type="absolute",col=brewer.pal(8,'Pastel2'), main="Absolute Item Frequency Plot",xlab='Items sold',ylab='Item Frequency (Absolute)')
itemFrequencyPlot(groceryTransactions,topN=20,type="relative",col=brewer.pal(8,'Pastel2'), main="Relative Item Frequency Plot",xlab='Items sold',ylab='Item Frequency (Relative)')
Whole milk, other vegetables, rolls/buns, soda, yogurt, bottled water, root vegetables, tropical fruits, shopping bags, sausage, pastry, citrus fruits, bottled beer, newspapers, canned beer, pip fruits, fruit/vegetable juice, whipped sour cream, brown bread and domestic eggs are the items sold most frequently.
Create Association rules using Apriori algorithm.
Create rules using apriori algorithm and check summary.
rules <- apriori(groceryTransactions, parameter = list(supp=0.001, conf=0.8))
## Apriori
##
## Parameter specification:
## confidence minval smax arem aval originalSupport maxtime support minlen
## 0.8 0.1 1 none FALSE TRUE 5 0.001 1
## maxlen target ext
## 10 rules FALSE
##
## Algorithmic control:
## filter tree heap memopt load sort verbose
## 0.1 TRUE TRUE FALSE TRUE 2 TRUE
##
## Absolute minimum support count: 9
##
## set item appearances ...[0 item(s)] done [0.00s].
## set transactions ...[169 item(s), 9835 transaction(s)] done [0.00s].
## sorting and recoding items ... [157 item(s)] done [0.00s].
## creating transaction tree ... done [0.01s].
## checking subsets of size 1 2 3 4 5 6 done [0.02s].
## writing ... [410 rule(s)] done [0.00s].
## creating S4 object ... done [0.00s].
summary(rules)
## set of 410 rules
##
## rule length distribution (lhs + rhs):sizes
## 3 4 5 6
## 29 229 140 12
##
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.000 4.000 4.000 4.329 5.000 6.000
##
## summary of quality measures:
## support confidence lift count
## Min. :0.001017 Min. :0.8000 Min. : 3.131 Min. :10.00
## 1st Qu.:0.001017 1st Qu.:0.8333 1st Qu.: 3.312 1st Qu.:10.00
## Median :0.001220 Median :0.8462 Median : 3.588 Median :12.00
## Mean :0.001247 Mean :0.8663 Mean : 3.951 Mean :12.27
## 3rd Qu.:0.001322 3rd Qu.:0.9091 3rd Qu.: 4.341 3rd Qu.:13.00
## Max. :0.003152 Max. :1.0000 Max. :11.235 Max. :31.00
##
## mining info:
## data ntransactions support confidence
## groceryTransactions 9835 0.001 0.8
410 rules are created on 9835 transactions by the algorithm with confidence ranging from 0.8 to 1
Inspect the 410 rules created to understand associations between items in the 9835 transactions.
inspect(rules)
## lhs rhs support confidence lift count
## [1] {liquor,
## red/blush wine} => {bottled beer} 0.001931876 0.9047619 11.235269 19
## [2] {cereals,
## curd} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [3] {cereals,
## yogurt} => {whole milk} 0.001728521 0.8095238 3.168192 17
## [4] {butter,
## jam} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [5] {bottled beer,
## soups} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [6] {house keeping products,
## napkins} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [7] {house keeping products,
## whipped/sour cream} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [8] {pastry,
## sweet spreads} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [9] {curd,
## turkey} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [10] {rice,
## sugar} => {whole milk} 0.001220132 1.0000000 3.913649 12
## [11] {butter,
## rice} => {whole milk} 0.001525165 0.8333333 3.261374 15
## [12] {domestic eggs,
## rice} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [13] {bottled water,
## rice} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [14] {rice,
## yogurt} => {other vegetables} 0.001931876 0.8260870 4.269346 19
## [15] {mustard,
## oil} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [16] {canned fish,
## hygiene articles} => {whole milk} 0.001118454 1.0000000 3.913649 11
## [17] {fruit/vegetable juice,
## herbs} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [18] {herbs,
## shopping bags} => {other vegetables} 0.001931876 0.8260870 4.269346 19
## [19] {herbs,
## tropical fruit} => {whole milk} 0.002338587 0.8214286 3.214783 23
## [20] {herbs,
## rolls/buns} => {whole milk} 0.002440264 0.8000000 3.130919 24
## [21] {chocolate,
## pickled vegetables} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [22] {grapes,
## onions} => {other vegetables} 0.001118454 0.9166667 4.737476 11
## [23] {margarine,
## meat} => {other vegetables} 0.001728521 0.8500000 4.392932 17
## [24] {hard cheese,
## oil} => {other vegetables} 0.001118454 0.9166667 4.737476 11
## [25] {butter milk,
## onions} => {other vegetables} 0.001321810 0.8125000 4.199126 13
## [26] {butter milk,
## pork} => {other vegetables} 0.001830198 0.8571429 4.429848 18
## [27] {onions,
## waffles} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [28] {curd,
## hamburger meat} => {whole milk} 0.002541942 0.8064516 3.156169 25
## [29] {bottled beer,
## hamburger meat} => {whole milk} 0.001728521 0.8095238 3.168192 17
## [30] {other vegetables,
## specialty cheese,
## yogurt} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [31] {root vegetables,
## tropical fruit,
## turkey} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [32] {root vegetables,
## turkey,
## whole milk} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [33] {butter,
## rice,
## root vegetables} => {whole milk} 0.001016777 1.0000000 3.913649 10
## [34] {other vegetables,
## rice,
## tropical fruit} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [35] {rice,
## root vegetables,
## yogurt} => {other vegetables} 0.001423488 0.8750000 4.522136 14
## [36] {rice,
## root vegetables,
## yogurt} => {whole milk} 0.001423488 0.8750000 3.424443 14
## [37] {other vegetables,
## rice,
## root vegetables} => {whole milk} 0.001830198 0.8181818 3.202076 18
## [38] {rice,
## whole milk,
## yogurt} => {other vegetables} 0.001525165 0.8333333 4.306796 15
## [39] {frozen fish,
## pip fruit,
## tropical fruit} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [40] {frozen fish,
## pip fruit,
## whole milk} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [41] {frozen fish,
## root vegetables,
## yogurt} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [42] {frozen fish,
## other vegetables,
## yogurt} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [43] {curd,
## herbs,
## root vegetables} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [44] {domestic eggs,
## herbs,
## other vegetables} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [45] {fruit/vegetable juice,
## herbs,
## other vegetables} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [46] {fruit/vegetable juice,
## herbs,
## whole milk} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [47] {citrus fruit,
## herbs,
## tropical fruit} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [48] {citrus fruit,
## herbs,
## tropical fruit} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [49] {citrus fruit,
## herbs,
## root vegetables} => {other vegetables} 0.001321810 0.8125000 4.199126 13
## [50] {citrus fruit,
## herbs,
## root vegetables} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [51] {herbs,
## root vegetables,
## shopping bags} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [52] {herbs,
## root vegetables,
## tropical fruit} => {whole milk} 0.001525165 0.8823529 3.453220 15
## [53] {herbs,
## tropical fruit,
## yogurt} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [54] {herbs,
## other vegetables,
## tropical fruit} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [55] {herbs,
## rolls/buns,
## root vegetables} => {whole milk} 0.001525165 0.8333333 3.261374 15
## [56] {semi-finished bread,
## tropical fruit,
## yogurt} => {other vegetables} 0.001321810 0.8125000 4.199126 13
## [57] {detergent,
## other vegetables,
## whipped/sour cream} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [58] {baking powder,
## tropical fruit,
## yogurt} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [59] {flour,
## other vegetables,
## sugar} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [60] {flour,
## root vegetables,
## whipped/sour cream} => {whole milk} 0.001728521 1.0000000 3.913649 17
## [61] {flour,
## rolls/buns,
## root vegetables} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [62] {butter,
## domestic eggs,
## soft cheese} => {whole milk} 0.001016777 1.0000000 3.913649 10
## [63] {butter,
## soft cheese,
## yogurt} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [64] {domestic eggs,
## root vegetables,
## soft cheese} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [65] {domestic eggs,
## root vegetables,
## soft cheese} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [66] {soft cheese,
## tropical fruit,
## whipped/sour cream} => {other vegetables} 0.001220132 0.9230769 4.770605 12
## [67] {root vegetables,
## soft cheese,
## whipped/sour cream} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [68] {citrus fruit,
## root vegetables,
## soft cheese} => {other vegetables} 0.001016777 1.0000000 5.168156 10
## [69] {grapes,
## pork,
## whole milk} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [70] {citrus fruit,
## fruit/vegetable juice,
## grapes} => {tropical fruit} 0.001118454 0.8461538 8.063879 11
## [71] {grapes,
## root vegetables,
## tropical fruit} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [72] {grapes,
## tropical fruit,
## yogurt} => {other vegetables} 0.001423488 0.8235294 4.256128 14
## [73] {grapes,
## tropical fruit,
## whole milk} => {other vegetables} 0.002033554 0.8000000 4.134524 20
## [74] {meat,
## tropical fruit,
## whole milk} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [75] {meat,
## root vegetables,
## yogurt} => {other vegetables} 0.001220132 0.8571429 4.429848 12
## [76] {curd,
## frozen meals,
## yogurt} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [77] {frankfurter,
## frozen meals,
## tropical fruit} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [78] {frankfurter,
## frozen meals,
## tropical fruit} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [79] {frankfurter,
## frozen meals,
## other vegetables} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [80] {butter,
## frozen meals,
## tropical fruit} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [81] {frozen meals,
## root vegetables,
## tropical fruit} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [82] {frozen meals,
## tropical fruit,
## yogurt} => {whole milk} 0.001626843 0.8000000 3.130919 16
## [83] {butter,
## hard cheese,
## yogurt} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [84] {hard cheese,
## tropical fruit,
## whipped/sour cream} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [85] {hard cheese,
## root vegetables,
## whipped/sour cream} => {other vegetables} 0.001321810 0.8125000 4.199126 13
## [86] {hard cheese,
## tropical fruit,
## yogurt} => {whole milk} 0.001423488 0.8235294 3.223005 14
## [87] {butter milk,
## dessert,
## yogurt} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [88] {butter milk,
## pork,
## whole milk} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [89] {butter milk,
## fruit/vegetable juice,
## pip fruit} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [90] {butter milk,
## pip fruit,
## root vegetables} => {other vegetables} 0.001220132 0.8571429 4.429848 12
## [91] {butter milk,
## other vegetables,
## pastry} => {yogurt} 0.001220132 0.8000000 5.734694 12
## [92] {butter milk,
## sausage,
## yogurt} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [93] {butter milk,
## root vegetables,
## yogurt} => {whole milk} 0.001525165 0.8823529 3.453220 15
## [94] {candy,
## rolls/buns,
## root vegetables} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [95] {frozen vegetables,
## ham,
## whole milk} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [96] {ham,
## pip fruit,
## tropical fruit} => {other vegetables} 0.001626843 0.8888889 4.593916 16
## [97] {frankfurter,
## root vegetables,
## sliced cheese} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [98] {frankfurter,
## sliced cheese,
## yogurt} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [99] {butter,
## sliced cheese,
## whipped/sour cream} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [100] {pip fruit,
## sausage,
## sliced cheese} => {yogurt} 0.001220132 0.8571429 6.144315 12
## [101] {coffee,
## oil,
## yogurt} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [102] {citrus fruit,
## fruit/vegetable juice,
## oil} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [103] {fruit/vegetable juice,
## oil,
## tropical fruit} => {other vegetables} 0.001220132 0.8571429 4.429848 12
## [104] {oil,
## root vegetables,
## shopping bags} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [105] {oil,
## root vegetables,
## tropical fruit} => {other vegetables} 0.001728521 0.8500000 4.392932 17
## [106] {frozen vegetables,
## onions,
## root vegetables} => {other vegetables} 0.001321810 0.8666667 4.479068 13
## [107] {curd,
## onions,
## yogurt} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [108] {napkins,
## onions,
## root vegetables} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [109] {napkins,
## onions,
## whole milk} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [110] {butter,
## domestic eggs,
## onions} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [111] {bottled water,
## butter,
## onions} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [112] {butter,
## onions,
## tropical fruit} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [113] {butter,
## onions,
## root vegetables} => {whole milk} 0.001728521 0.8500000 3.326602 17
## [114] {butter,
## onions,
## yogurt} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [115] {citrus fruit,
## onions,
## root vegetables} => {other vegetables} 0.001423488 0.8235294 4.256128 14
## [116] {onions,
## root vegetables,
## tropical fruit} => {other vegetables} 0.001626843 0.8888889 4.593916 16
## [117] {berries,
## butter,
## whipped/sour cream} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [118] {berries,
## butter,
## sausage} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [119] {curd,
## hamburger meat,
## other vegetables} => {whole milk} 0.001626843 0.8000000 3.130919 16
## [120] {butter,
## hamburger meat,
## whipped/sour cream} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [121] {hamburger meat,
## tropical fruit,
## whipped/sour cream} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [122] {hamburger meat,
## root vegetables,
## whipped/sour cream} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [123] {butter,
## hygiene articles,
## napkins} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [124] {hygiene articles,
## napkins,
## tropical fruit} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [125] {hygiene articles,
## margarine,
## rolls/buns} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [126] {butter,
## hygiene articles,
## pip fruit} => {whole milk} 0.001016777 1.0000000 3.913649 10
## [127] {butter,
## citrus fruit,
## hygiene articles} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [128] {bottled water,
## butter,
## hygiene articles} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [129] {butter,
## hygiene articles,
## tropical fruit} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [130] {butter,
## hygiene articles,
## root vegetables} => {whole milk} 0.001423488 0.8235294 3.223005 14
## [131] {domestic eggs,
## hygiene articles,
## tropical fruit} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [132] {hygiene articles,
## tropical fruit,
## whipped/sour cream} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [133] {hygiene articles,
## root vegetables,
## whipped/sour cream} => {whole milk} 0.001016777 1.0000000 3.913649 10
## [134] {hygiene articles,
## pip fruit,
## sausage} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [135] {hygiene articles,
## pip fruit,
## root vegetables} => {whole milk} 0.001016777 1.0000000 3.913649 10
## [136] {citrus fruit,
## hygiene articles,
## root vegetables} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [137] {hygiene articles,
## root vegetables,
## yogurt} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [138] {long life bakery product,
## other vegetables,
## salty snack} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [139] {salty snack,
## tropical fruit,
## whipped/sour cream} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [140] {pip fruit,
## salty snack,
## yogurt} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [141] {salty snack,
## tropical fruit,
## yogurt} => {other vegetables} 0.001321810 0.8125000 4.199126 13
## [142] {root vegetables,
## salty snack,
## yogurt} => {other vegetables} 0.001220132 0.8571429 4.429848 12
## [143] {cream cheese,
## domestic eggs,
## sugar} => {whole milk} 0.001118454 1.0000000 3.913649 11
## [144] {cream cheese,
## other vegetables,
## sugar} => {whole milk} 0.001525165 0.9375000 3.669046 15
## [145] {beef,
## root vegetables,
## sugar} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [146] {curd,
## domestic eggs,
## sugar} => {whole milk} 0.001016777 1.0000000 3.913649 10
## [147] {butter,
## sugar,
## whipped/sour cream} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [148] {butter,
## sugar,
## whipped/sour cream} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [149] {citrus fruit,
## domestic eggs,
## sugar} => {whole milk} 0.001423488 0.9333333 3.652739 14
## [150] {domestic eggs,
## sugar,
## tropical fruit} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [151] {domestic eggs,
## sugar,
## yogurt} => {whole milk} 0.001423488 0.9333333 3.652739 14
## [152] {citrus fruit,
## sugar,
## whipped/sour cream} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [153] {root vegetables,
## sugar,
## whipped/sour cream} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [154] {bottled water,
## other vegetables,
## sugar} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [155] {pork,
## rolls/buns,
## waffles} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [156] {rolls/buns,
## waffles,
## whipped/sour cream} => {whole milk} 0.001728521 0.8095238 3.168192 17
## [157] {rolls/buns,
## root vegetables,
## waffles} => {whole milk} 0.001626843 0.8421053 3.295704 16
## [158] {long life bakery product,
## napkins,
## whipped/sour cream} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [159] {long life bakery product,
## napkins,
## tropical fruit} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [160] {long life bakery product,
## napkins,
## other vegetables} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [161] {butter,
## long life bakery product,
## whipped/sour cream} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [162] {butter,
## long life bakery product,
## sausage} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [163] {long life bakery product,
## sausage,
## whipped/sour cream} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [164] {long life bakery product,
## whipped/sour cream,
## yogurt} => {whole milk} 0.001728521 0.8095238 3.168192 17
## [165] {long life bakery product,
## root vegetables,
## tropical fruit} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [166] {dessert,
## sausage,
## whipped/sour cream} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [167] {dessert,
## tropical fruit,
## whipped/sour cream} => {other vegetables} 0.001118454 0.9166667 4.737476 11
## [168] {cream cheese,
## curd,
## root vegetables} => {other vegetables} 0.001728521 0.8500000 4.392932 17
## [169] {cream cheese,
## domestic eggs,
## napkins} => {whole milk} 0.001118454 1.0000000 3.913649 11
## [170] {cream cheese,
## pork,
## yogurt} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [171] {cream cheese,
## frankfurter,
## yogurt} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [172] {cream cheese,
## margarine,
## whipped/sour cream} => {yogurt} 0.001016777 0.8333333 5.973639 10
## [173] {butter,
## cream cheese,
## whipped/sour cream} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [174] {butter,
## cream cheese,
## root vegetables} => {yogurt} 0.001016777 0.9090909 6.516698 10
## [175] {butter,
## cream cheese,
## root vegetables} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [176] {cream cheese,
## domestic eggs,
## whipped/sour cream} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [177] {cream cheese,
## domestic eggs,
## pip fruit} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [178] {citrus fruit,
## cream cheese,
## domestic eggs} => {whole milk} 0.001626843 0.8888889 3.478799 16
## [179] {cream cheese,
## domestic eggs,
## yogurt} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [180] {cream cheese,
## pip fruit,
## whipped/sour cream} => {whole milk} 0.001321810 0.9285714 3.634103 13
## [181] {citrus fruit,
## cream cheese,
## whipped/sour cream} => {other vegetables} 0.001321810 0.8125000 4.199126 13
## [182] {cream cheese,
## tropical fruit,
## whipped/sour cream} => {other vegetables} 0.001423488 0.8750000 4.522136 14
## [183] {cream cheese,
## pip fruit,
## sausage} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [184] {citrus fruit,
## cream cheese,
## root vegetables} => {other vegetables} 0.001220132 0.9230769 4.770605 12
## [185] {butter,
## chicken,
## whipped/sour cream} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [186] {chicken,
## domestic eggs,
## sausage} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [187] {chicken,
## pastry,
## root vegetables} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [188] {butter,
## tropical fruit,
## white bread} => {yogurt} 0.001118454 0.8461538 6.065542 11
## [189] {butter,
## tropical fruit,
## white bread} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [190] {butter,
## root vegetables,
## white bread} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [191] {butter,
## root vegetables,
## white bread} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [192] {tropical fruit,
## whipped/sour cream,
## white bread} => {other vegetables} 0.001728521 0.8500000 4.392932 17
## [193] {root vegetables,
## whipped/sour cream,
## white bread} => {other vegetables} 0.001423488 0.8750000 4.522136 14
## [194] {root vegetables,
## whipped/sour cream,
## white bread} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [195] {chocolate,
## napkins,
## root vegetables} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [196] {chocolate,
## domestic eggs,
## sausage} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [197] {bottled beer,
## coffee,
## yogurt} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [198] {butter,
## coffee,
## whipped/sour cream} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [199] {coffee,
## domestic eggs,
## root vegetables} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [200] {citrus fruit,
## frozen vegetables,
## napkins} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [201] {frozen vegetables,
## napkins,
## other vegetables} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [202] {frozen vegetables,
## margarine,
## rolls/buns} => {whole milk} 0.001321810 0.8666667 3.391829 13
## [203] {citrus fruit,
## frozen vegetables,
## fruit/vegetable juice} => {whole milk} 0.001626843 0.8421053 3.295704 16
## [204] {beef,
## butter,
## curd} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [205] {beef,
## butter,
## tropical fruit} => {yogurt} 0.001016777 0.8333333 5.973639 10
## [206] {beef,
## tropical fruit,
## whipped/sour cream} => {other vegetables} 0.001423488 0.8750000 4.522136 14
## [207] {beef,
## tropical fruit,
## whipped/sour cream} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [208] {curd,
## margarine,
## rolls/buns} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [209] {butter,
## curd,
## domestic eggs} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [210] {butter,
## curd,
## domestic eggs} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [211] {butter,
## curd,
## pip fruit} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [212] {butter,
## citrus fruit,
## curd} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [213] {curd,
## domestic eggs,
## other vegetables} => {whole milk} 0.002846975 0.8235294 3.223005 28
## [214] {curd,
## pip fruit,
## whipped/sour cream} => {whole milk} 0.001830198 0.8181818 3.202076 18
## [215] {bottled beer,
## napkins,
## rolls/buns} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [216] {butter,
## napkins,
## whipped/sour cream} => {whole milk} 0.001423488 0.8235294 3.223005 14
## [217] {bottled water,
## butter,
## napkins} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [218] {butter,
## napkins,
## yogurt} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [219] {domestic eggs,
## napkins,
## tropical fruit} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [220] {bottled beer,
## pork,
## rolls/buns} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [221] {butter,
## pork,
## whipped/sour cream} => {whole milk} 0.001423488 0.8750000 3.424443 14
## [222] {butter,
## pork,
## yogurt} => {whole milk} 0.001423488 0.8235294 3.223005 14
## [223] {butter,
## other vegetables,
## pork} => {whole milk} 0.002236909 0.8461538 3.311549 22
## [224] {fruit/vegetable juice,
## pork,
## tropical fruit} => {yogurt} 0.001016777 0.8333333 5.973639 10
## [225] {pip fruit,
## pork,
## soda} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [226] {bottled beer,
## domestic eggs,
## margarine} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [227] {brown bread,
## domestic eggs,
## root vegetables} => {whole milk} 0.001525165 0.8333333 3.261374 15
## [228] {brown bread,
## pip fruit,
## whipped/sour cream} => {other vegetables} 0.001118454 1.0000000 5.168156 11
## [229] {brown bread,
## sausage,
## whipped/sour cream} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [230] {brown bread,
## pip fruit,
## root vegetables} => {other vegetables} 0.001321810 0.8125000 4.199126 13
## [231] {brown bread,
## pip fruit,
## root vegetables} => {whole milk} 0.001423488 0.8750000 3.424443 14
## [232] {butter,
## margarine,
## tropical fruit} => {yogurt} 0.001118454 0.8461538 6.065542 11
## [233] {domestic eggs,
## fruit/vegetable juice,
## margarine} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [234] {domestic eggs,
## margarine,
## whipped/sour cream} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [235] {bottled water,
## margarine,
## whipped/sour cream} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [236] {margarine,
## rolls/buns,
## whipped/sour cream} => {whole milk} 0.001626843 0.8888889 3.478799 16
## [237] {butter,
## domestic eggs,
## whipped/sour cream} => {whole milk} 0.001626843 0.8421053 3.295704 16
## [238] {butter,
## domestic eggs,
## pip fruit} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [239] {butter,
## pip fruit,
## whipped/sour cream} => {whole milk} 0.001830198 0.9000000 3.522284 18
## [240] {bottled water,
## butter,
## whipped/sour cream} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [241] {butter,
## soda,
## whipped/sour cream} => {other vegetables} 0.001321810 0.9285714 4.799002 13
## [242] {butter,
## pastry,
## pip fruit} => {other vegetables} 0.001321810 0.9285714 4.799002 13
## [243] {bottled water,
## butter,
## pip fruit} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [244] {butter,
## pip fruit,
## root vegetables} => {whole milk} 0.001728521 0.8095238 3.168192 17
## [245] {butter,
## citrus fruit,
## tropical fruit} => {whole milk} 0.001626843 0.8000000 3.130919 16
## [246] {citrus fruit,
## newspapers,
## root vegetables} => {other vegetables} 0.001626843 0.8421053 4.352131 16
## [247] {domestic eggs,
## pastry,
## whipped/sour cream} => {other vegetables} 0.001220132 0.8571429 4.429848 12
## [248] {domestic eggs,
## tropical fruit,
## whipped/sour cream} => {whole milk} 0.001830198 0.9000000 3.522284 18
## [249] {domestic eggs,
## pip fruit,
## sausage} => {whole milk} 0.001423488 0.8235294 3.223005 14
## [250] {domestic eggs,
## pastry,
## tropical fruit} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [251] {domestic eggs,
## pastry,
## root vegetables} => {other vegetables} 0.001220132 0.8571429 4.429848 12
## [252] {fruit/vegetable juice,
## pastry,
## whipped/sour cream} => {yogurt} 0.001220132 0.8000000 5.734694 12
## [253] {fruit/vegetable juice,
## tropical fruit,
## whipped/sour cream} => {other vegetables} 0.001931876 0.9047619 4.675950 19
## [254] {pip fruit,
## sausage,
## whipped/sour cream} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [255] {citrus fruit,
## pastry,
## whipped/sour cream} => {whole milk} 0.001525165 0.8823529 3.453220 15
## [256] {bottled water,
## sausage,
## whipped/sour cream} => {other vegetables} 0.001321810 0.8125000 4.199126 13
## [257] {citrus fruit,
## pastry,
## root vegetables} => {other vegetables} 0.001525165 0.8823529 4.560137 15
## [258] {pastry,
## root vegetables,
## shopping bags} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [259] {other vegetables,
## rice,
## root vegetables,
## yogurt} => {whole milk} 0.001321810 0.9285714 3.634103 13
## [260] {rice,
## root vegetables,
## whole milk,
## yogurt} => {other vegetables} 0.001321810 0.9285714 4.799002 13
## [261] {other vegetables,
## rice,
## whole milk,
## yogurt} => {root vegetables} 0.001321810 0.8666667 7.951182 13
## [262] {herbs,
## other vegetables,
## root vegetables,
## tropical fruit} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [263] {herbs,
## other vegetables,
## rolls/buns,
## root vegetables} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [264] {grapes,
## tropical fruit,
## whole milk,
## yogurt} => {other vegetables} 0.001016777 1.0000000 5.168156 10
## [265] {frozen meals,
## pip fruit,
## tropical fruit,
## yogurt} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [266] {hard cheese,
## root vegetables,
## whipped/sour cream,
## whole milk} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [267] {hard cheese,
## other vegetables,
## root vegetables,
## yogurt} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [268] {butter milk,
## other vegetables,
## root vegetables,
## yogurt} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [269] {ham,
## pip fruit,
## tropical fruit,
## yogurt} => {other vegetables} 0.001016777 1.0000000 5.168156 10
## [270] {ham,
## other vegetables,
## pip fruit,
## yogurt} => {tropical fruit} 0.001016777 0.8333333 7.941699 10
## [271] {ham,
## pip fruit,
## tropical fruit,
## whole milk} => {other vegetables} 0.001118454 1.0000000 5.168156 11
## [272] {butter,
## sliced cheese,
## tropical fruit,
## yogurt} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [273] {butter,
## sliced cheese,
## tropical fruit,
## whole milk} => {yogurt} 0.001016777 0.9090909 6.516698 10
## [274] {root vegetables,
## sliced cheese,
## tropical fruit,
## yogurt} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [275] {oil,
## root vegetables,
## tropical fruit,
## yogurt} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [276] {oil,
## root vegetables,
## tropical fruit,
## yogurt} => {whole milk} 0.001118454 1.0000000 3.913649 11
## [277] {oil,
## root vegetables,
## tropical fruit,
## whole milk} => {other vegetables} 0.001321810 0.8666667 4.479068 13
## [278] {oil,
## other vegetables,
## tropical fruit,
## whole milk} => {root vegetables} 0.001321810 0.8666667 7.951182 13
## [279] {oil,
## other vegetables,
## root vegetables,
## yogurt} => {whole milk} 0.001423488 1.0000000 3.913649 14
## [280] {oil,
## root vegetables,
## whole milk,
## yogurt} => {other vegetables} 0.001423488 0.9333333 4.823612 14
## [281] {butter,
## onions,
## other vegetables,
## root vegetables} => {whole milk} 0.001321810 0.8666667 3.391829 13
## [282] {onions,
## root vegetables,
## tropical fruit,
## whole milk} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [283] {other vegetables,
## root vegetables,
## waffles,
## yogurt} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [284] {long life bakery product,
## other vegetables,
## whipped/sour cream,
## yogurt} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [285] {cream cheese,
## curd,
## other vegetables,
## whipped/sour cream} => {yogurt} 0.001016777 0.9090909 6.516698 10
## [286] {cream cheese,
## curd,
## whipped/sour cream,
## yogurt} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [287] {cream cheese,
## curd,
## whipped/sour cream,
## whole milk} => {yogurt} 0.001118454 0.8461538 6.065542 11
## [288] {citrus fruit,
## cream cheese,
## domestic eggs,
## other vegetables} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [289] {citrus fruit,
## cream cheese,
## other vegetables,
## whipped/sour cream} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [290] {citrus fruit,
## cream cheese,
## whipped/sour cream,
## whole milk} => {other vegetables} 0.001118454 0.9166667 4.737476 11
## [291] {cream cheese,
## other vegetables,
## pip fruit,
## root vegetables} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [292] {cream cheese,
## other vegetables,
## pip fruit,
## yogurt} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [293] {cream cheese,
## tropical fruit,
## whole milk,
## yogurt} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [294] {chicken,
## domestic eggs,
## other vegetables,
## root vegetables} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [295] {butter,
## tropical fruit,
## white bread,
## yogurt} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [296] {butter,
## other vegetables,
## tropical fruit,
## white bread} => {yogurt} 0.001016777 0.9090909 6.516698 10
## [297] {butter,
## other vegetables,
## root vegetables,
## white bread} => {whole milk} 0.001016777 1.0000000 3.913649 10
## [298] {butter,
## root vegetables,
## white bread,
## whole milk} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [299] {butter,
## white bread,
## whole milk,
## yogurt} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [300] {root vegetables,
## whipped/sour cream,
## white bread,
## whole milk} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [301] {pip fruit,
## root vegetables,
## white bread,
## yogurt} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [302] {citrus fruit,
## frozen vegetables,
## fruit/vegetable juice,
## other vegetables} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [303] {frozen vegetables,
## fruit/vegetable juice,
## other vegetables,
## root vegetables} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [304] {frozen vegetables,
## other vegetables,
## root vegetables,
## whipped/sour cream} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [305] {frozen vegetables,
## whipped/sour cream,
## whole milk,
## yogurt} => {other vegetables} 0.001525165 0.8823529 4.560137 15
## [306] {citrus fruit,
## frozen vegetables,
## other vegetables,
## yogurt} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [307] {bottled water,
## frozen vegetables,
## other vegetables,
## root vegetables} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [308] {bottled water,
## frozen vegetables,
## root vegetables,
## whole milk} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [309] {frozen vegetables,
## root vegetables,
## whole milk,
## yogurt} => {other vegetables} 0.001525165 0.8823529 4.560137 15
## [310] {beef,
## tropical fruit,
## whipped/sour cream,
## whole milk} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [311] {beef,
## citrus fruit,
## root vegetables,
## tropical fruit} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [312] {beef,
## citrus fruit,
## other vegetables,
## tropical fruit} => {root vegetables} 0.001016777 0.8333333 7.645367 10
## [313] {beef,
## rolls/buns,
## root vegetables,
## tropical fruit} => {whole milk} 0.001423488 0.8235294 3.223005 14
## [314] {beef,
## rolls/buns,
## tropical fruit,
## yogurt} => {whole milk} 0.001321810 0.9285714 3.634103 13
## [315] {beef,
## other vegetables,
## rolls/buns,
## tropical fruit} => {whole milk} 0.001525165 0.8823529 3.453220 15
## [316] {butter,
## curd,
## other vegetables,
## tropical fruit} => {yogurt} 0.001016777 0.8333333 5.973639 10
## [317] {butter,
## curd,
## tropical fruit,
## yogurt} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [318] {butter,
## curd,
## tropical fruit,
## whole milk} => {yogurt} 0.001220132 0.8571429 6.144315 12
## [319] {curd,
## domestic eggs,
## tropical fruit,
## yogurt} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [320] {curd,
## domestic eggs,
## other vegetables,
## root vegetables} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [321] {curd,
## other vegetables,
## pip fruit,
## whipped/sour cream} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [322] {citrus fruit,
## curd,
## tropical fruit,
## yogurt} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [323] {citrus fruit,
## curd,
## root vegetables,
## whole milk} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [324] {citrus fruit,
## curd,
## other vegetables,
## yogurt} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [325] {butter,
## napkins,
## other vegetables,
## whipped/sour cream} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [326] {butter,
## other vegetables,
## pork,
## whipped/sour cream} => {whole milk} 0.001016777 1.0000000 3.913649 10
## [327] {butter,
## other vegetables,
## pork,
## root vegetables} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [328] {frankfurter,
## other vegetables,
## pip fruit,
## root vegetables} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [329] {frankfurter,
## pip fruit,
## root vegetables,
## whole milk} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [330] {frankfurter,
## root vegetables,
## tropical fruit,
## yogurt} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [331] {frankfurter,
## other vegetables,
## tropical fruit,
## yogurt} => {whole milk} 0.001423488 0.8235294 3.223005 14
## [332] {brown bread,
## pip fruit,
## tropical fruit,
## yogurt} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [333] {brown bread,
## other vegetables,
## pip fruit,
## root vegetables} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [334] {brown bread,
## pip fruit,
## root vegetables,
## whole milk} => {other vegetables} 0.001220132 0.8571429 4.429848 12
## [335] {brown bread,
## citrus fruit,
## other vegetables,
## root vegetables} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [336] {brown bread,
## other vegetables,
## rolls/buns,
## root vegetables} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [337] {brown bread,
## other vegetables,
## soda,
## yogurt} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [338] {margarine,
## root vegetables,
## tropical fruit,
## whole milk} => {yogurt} 0.001016777 0.8333333 5.973639 10
## [339] {margarine,
## rolls/buns,
## root vegetables,
## yogurt} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [340] {margarine,
## other vegetables,
## rolls/buns,
## root vegetables} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [341] {butter,
## domestic eggs,
## other vegetables,
## whipped/sour cream} => {whole milk} 0.001220132 1.0000000 3.913649 12
## [342] {butter,
## domestic eggs,
## tropical fruit,
## yogurt} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [343] {butter,
## domestic eggs,
## tropical fruit,
## yogurt} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [344] {butter,
## domestic eggs,
## root vegetables,
## yogurt} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [345] {butter,
## fruit/vegetable juice,
## tropical fruit,
## whipped/sour cream} => {other vegetables} 0.001016777 1.0000000 5.168156 10
## [346] {butter,
## other vegetables,
## pip fruit,
## whipped/sour cream} => {whole milk} 0.001321810 0.8666667 3.391829 13
## [347] {butter,
## root vegetables,
## tropical fruit,
## whipped/sour cream} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [348] {butter,
## tropical fruit,
## whipped/sour cream,
## yogurt} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [349] {butter,
## tropical fruit,
## whipped/sour cream,
## yogurt} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [350] {butter,
## root vegetables,
## whipped/sour cream,
## yogurt} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [351] {butter,
## soda,
## whipped/sour cream,
## whole milk} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [352] {butter,
## other vegetables,
## rolls/buns,
## whipped/sour cream} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [353] {bottled water,
## butter,
## citrus fruit,
## other vegetables} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [354] {butter,
## root vegetables,
## tropical fruit,
## yogurt} => {whole milk} 0.001728521 0.8947368 3.501686 17
## [355] {citrus fruit,
## newspapers,
## root vegetables,
## whole milk} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [356] {newspapers,
## soda,
## tropical fruit,
## whole milk} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [357] {newspapers,
## rolls/buns,
## soda,
## whole milk} => {other vegetables} 0.001016777 1.0000000 5.168156 10
## [358] {domestic eggs,
## other vegetables,
## pip fruit,
## whipped/sour cream} => {whole milk} 0.001220132 0.9230769 3.612599 12
## [359] {domestic eggs,
## pip fruit,
## whipped/sour cream,
## whole milk} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [360] {citrus fruit,
## domestic eggs,
## other vegetables,
## whipped/sour cream} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [361] {citrus fruit,
## domestic eggs,
## whipped/sour cream,
## whole milk} => {other vegetables} 0.001220132 0.9230769 4.770605 12
## [362] {domestic eggs,
## tropical fruit,
## whipped/sour cream,
## yogurt} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [363] {domestic eggs,
## other vegetables,
## tropical fruit,
## whipped/sour cream} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [364] {domestic eggs,
## other vegetables,
## pip fruit,
## root vegetables} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [365] {citrus fruit,
## domestic eggs,
## other vegetables,
## tropical fruit} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [366] {citrus fruit,
## domestic eggs,
## root vegetables,
## whole milk} => {other vegetables} 0.001220132 0.8571429 4.429848 12
## [367] {domestic eggs,
## root vegetables,
## tropical fruit,
## yogurt} => {whole milk} 0.001525165 0.8333333 3.261374 15
## [368] {fruit/vegetable juice,
## tropical fruit,
## whipped/sour cream,
## yogurt} => {other vegetables} 0.001118454 0.9166667 4.737476 11
## [369] {fruit/vegetable juice,
## tropical fruit,
## whipped/sour cream,
## whole milk} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [370] {fruit/vegetable juice,
## pip fruit,
## root vegetables,
## yogurt} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [371] {fruit/vegetable juice,
## other vegetables,
## pip fruit,
## root vegetables} => {whole milk} 0.001321810 0.8666667 3.391829 13
## [372] {citrus fruit,
## fruit/vegetable juice,
## tropical fruit,
## whole milk} => {other vegetables} 0.001321810 0.8125000 4.199126 13
## [373] {citrus fruit,
## fruit/vegetable juice,
## other vegetables,
## soda} => {root vegetables} 0.001016777 0.9090909 8.340400 10
## [374] {citrus fruit,
## fruit/vegetable juice,
## whole milk,
## yogurt} => {other vegetables} 0.001423488 0.8235294 4.256128 14
## [375] {fruit/vegetable juice,
## root vegetables,
## tropical fruit,
## yogurt} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [376] {fruit/vegetable juice,
## other vegetables,
## root vegetables,
## yogurt} => {whole milk} 0.002033554 0.8333333 3.261374 20
## [377] {fruit/vegetable juice,
## root vegetables,
## whole milk,
## yogurt} => {other vegetables} 0.002033554 0.8000000 4.134524 20
## [378] {pip fruit,
## tropical fruit,
## whipped/sour cream,
## whole milk} => {other vegetables} 0.001626843 0.8000000 4.134524 16
## [379] {other vegetables,
## pip fruit,
## root vegetables,
## whipped/sour cream} => {whole milk} 0.001728521 0.8500000 3.326602 17
## [380] {citrus fruit,
## pastry,
## rolls/buns,
## whipped/sour cream} => {whole milk} 0.001016777 1.0000000 3.913649 10
## [381] {citrus fruit,
## other vegetables,
## sausage,
## whipped/sour cream} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [382] {citrus fruit,
## sausage,
## whipped/sour cream,
## whole milk} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [383] {citrus fruit,
## root vegetables,
## tropical fruit,
## whipped/sour cream} => {other vegetables} 0.001220132 1.0000000 5.168156 12
## [384] {citrus fruit,
## tropical fruit,
## whipped/sour cream,
## yogurt} => {whole milk} 0.001220132 0.8000000 3.130919 12
## [385] {rolls/buns,
## root vegetables,
## tropical fruit,
## whipped/sour cream} => {other vegetables} 0.001220132 0.8000000 4.134524 12
## [386] {bottled water,
## other vegetables,
## pip fruit,
## root vegetables} => {whole milk} 0.001118454 1.0000000 3.913649 11
## [387] {pip fruit,
## root vegetables,
## soda,
## yogurt} => {whole milk} 0.001220132 0.8571429 3.354556 12
## [388] {other vegetables,
## pip fruit,
## root vegetables,
## soda} => {whole milk} 0.001321810 0.8125000 3.179840 13
## [389] {pastry,
## root vegetables,
## tropical fruit,
## yogurt} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [390] {bottled water,
## citrus fruit,
## other vegetables,
## tropical fruit} => {whole milk} 0.001321810 0.8666667 3.391829 13
## [391] {citrus fruit,
## root vegetables,
## tropical fruit,
## yogurt} => {other vegetables} 0.001728521 0.8095238 4.183745 17
## [392] {citrus fruit,
## rolls/buns,
## root vegetables,
## tropical fruit} => {other vegetables} 0.001118454 0.8461538 4.373055 11
## [393] {citrus fruit,
## root vegetables,
## tropical fruit,
## whole milk} => {other vegetables} 0.003152008 0.8857143 4.577509 31
## [394] {citrus fruit,
## other vegetables,
## root vegetables,
## yogurt} => {whole milk} 0.002338587 0.8214286 3.214783 23
## [395] {root vegetables,
## sausage,
## tropical fruit,
## yogurt} => {whole milk} 0.001525165 0.9375000 3.669046 15
## [396] {rolls/buns,
## root vegetables,
## sausage,
## tropical fruit} => {whole milk} 0.001016777 1.0000000 3.913649 10
## [397] {bottled water,
## rolls/buns,
## root vegetables,
## tropical fruit} => {whole milk} 0.001118454 0.9166667 3.587512 11
## [398] {rolls/buns,
## root vegetables,
## tropical fruit,
## yogurt} => {whole milk} 0.002236909 0.8148148 3.188899 22
## [399] {oil,
## other vegetables,
## root vegetables,
## tropical fruit,
## yogurt} => {whole milk} 0.001016777 1.0000000 3.913649 10
## [400] {oil,
## root vegetables,
## tropical fruit,
## whole milk,
## yogurt} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [401] {oil,
## other vegetables,
## tropical fruit,
## whole milk,
## yogurt} => {root vegetables} 0.001016777 0.9090909 8.340400 10
## [402] {beef,
## other vegetables,
## rolls/buns,
## root vegetables,
## tropical fruit} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [403] {butter,
## domestic eggs,
## other vegetables,
## tropical fruit,
## yogurt} => {whole milk} 0.001016777 0.9090909 3.557863 10
## [404] {butter,
## domestic eggs,
## tropical fruit,
## whole milk,
## yogurt} => {other vegetables} 0.001016777 0.8333333 4.306796 10
## [405] {butter,
## other vegetables,
## root vegetables,
## tropical fruit,
## yogurt} => {whole milk} 0.001118454 0.8461538 3.311549 11
## [406] {citrus fruit,
## other vegetables,
## root vegetables,
## whipped/sour cream,
## yogurt} => {whole milk} 0.001016777 0.8333333 3.261374 10
## [407] {citrus fruit,
## root vegetables,
## whipped/sour cream,
## whole milk,
## yogurt} => {other vegetables} 0.001016777 0.9090909 4.698323 10
## [408] {other vegetables,
## pip fruit,
## root vegetables,
## tropical fruit,
## yogurt} => {whole milk} 0.001321810 0.8666667 3.391829 13
## [409] {citrus fruit,
## other vegetables,
## root vegetables,
## tropical fruit,
## yogurt} => {whole milk} 0.001423488 0.8235294 3.223005 14
## [410] {citrus fruit,
## root vegetables,
## tropical fruit,
## whole milk,
## yogurt} => {other vegetables} 0.001423488 0.9333333 4.823612 14
write(rules,file = "rules.txt")
Visualization of Rules
Plot the rules and see the patterns.
#Plot the rules
plotly_arules(rules, measure = c("support", "confidence"), shading = "lift")
## Warning: 'plotly_arules' is deprecated.
## Use 'plot' instead.
## See help("Deprecated")
## To reduce overplotting, jitter is added! Use jitter = 0 to prevent jitter.
plotly_arules(rules, method = "matrix")
## Warning: 'plotly_arules' is deprecated.
## Use 'plot' instead.
## See help("Deprecated")
# add jitter, change color and markers and add a title
plotly_arules(rules, jitter = 10,
marker = list(opacity = .7, size = 10, symbol = 1),
colors = c("red", "blue"))
## Warning: 'plotly_arules' is deprecated.
## Use 'plot' instead.
## See help("Deprecated")
The dots and lines which are having more red color represent the rules with higher values of lift. Observe them to understand the dependencies among items while at the time of purchasing.
Top 10 rules by Lift
Get top 10 rules by lift. Inspect them.
# Filter top 10 rules with highest lift
top10RulesByLift <- head(rules, n = 10, by = "lift")
inspect(top10RulesByLift)
## lhs rhs support confidence lift count
## [1] {liquor,
## red/blush wine} => {bottled beer} 0.001931876 0.9047619 11.235269 19
## [2] {citrus fruit,
## fruit/vegetable juice,
## other vegetables,
## soda} => {root vegetables} 0.001016777 0.9090909 8.340400 10
## [3] {oil,
## other vegetables,
## tropical fruit,
## whole milk,
## yogurt} => {root vegetables} 0.001016777 0.9090909 8.340400 10
## [4] {citrus fruit,
## fruit/vegetable juice,
## grapes} => {tropical fruit} 0.001118454 0.8461538 8.063879 11
## [5] {other vegetables,
## rice,
## whole milk,
## yogurt} => {root vegetables} 0.001321810 0.8666667 7.951182 13
## [6] {oil,
## other vegetables,
## tropical fruit,
## whole milk} => {root vegetables} 0.001321810 0.8666667 7.951182 13
## [7] {ham,
## other vegetables,
## pip fruit,
## yogurt} => {tropical fruit} 0.001016777 0.8333333 7.941699 10
## [8] {beef,
## citrus fruit,
## other vegetables,
## tropical fruit} => {root vegetables} 0.001016777 0.8333333 7.645367 10
## [9] {butter,
## cream cheese,
## root vegetables} => {yogurt} 0.001016777 0.9090909 6.516698 10
## [10] {butter,
## sliced cheese,
## tropical fruit,
## whole milk} => {yogurt} 0.001016777 0.9090909 6.516698 10
Customers are buying bottled beer after buying liquor, red/blush wine. Customers are buying root vegetables after buying fruits, other vegetables, beef, milk and yogurt. Customers are buying tropical fruits after buying ham, other vegetables, pip fruit, citrus fruits, grapes and yogurt. Customers are buying yogurt after buying butter, cheese, root vegetables, tropical fruit and whole milk.
Visualize the plots for top 10 rules by lift.
plot(top10RulesByLift, engine = "plotly")
## To reduce overplotting, jitter is added! Use jitter = 0 to prevent jitter.
plot(top10RulesByLift, method="graph")
plot(top10RulesByLift, method = "grouped")
plot(top10RulesByLift, method = "graph", engine = "htmlwidget")
plot(top10RulesByLift, method="paracoord")
Top 10 rules by Confidence
Get top 10 rules by confidence. Inspect them.
# Filter top 10 rules with highest confidence
top10RulesByConfidence <- head(rules, n = 10, by = "confidence")
inspect(top10RulesByConfidence)
## lhs rhs support confidence lift count
## [1] {rice,
## sugar} => {whole milk} 0.001220132 1 3.913649 12
## [2] {canned fish,
## hygiene articles} => {whole milk} 0.001118454 1 3.913649 11
## [3] {butter,
## rice,
## root vegetables} => {whole milk} 0.001016777 1 3.913649 10
## [4] {flour,
## root vegetables,
## whipped/sour cream} => {whole milk} 0.001728521 1 3.913649 17
## [5] {butter,
## domestic eggs,
## soft cheese} => {whole milk} 0.001016777 1 3.913649 10
## [6] {citrus fruit,
## root vegetables,
## soft cheese} => {other vegetables} 0.001016777 1 5.168156 10
## [7] {butter,
## hygiene articles,
## pip fruit} => {whole milk} 0.001016777 1 3.913649 10
## [8] {hygiene articles,
## root vegetables,
## whipped/sour cream} => {whole milk} 0.001016777 1 3.913649 10
## [9] {hygiene articles,
## pip fruit,
## root vegetables} => {whole milk} 0.001016777 1 3.913649 10
## [10] {cream cheese,
## domestic eggs,
## sugar} => {whole milk} 0.001118454 1 3.913649 11
Customers are buying whole milk after buying rice, sugar, canned fish, eggs, cheese, butter, hygiene articles, root vegetables, pip fruit and sour cream. Customers are buying other vegetables after buying citrus fruit, root vegetables and soft cheese.
Visualize the plots for top 10 rules by confidence.
plot(top10RulesByConfidence, engine = "plotly")
## To reduce overplotting, jitter is added! Use jitter = 0 to prevent jitter.
plot(top10RulesByConfidence, method="graph")
plot(top10RulesByConfidence, method = "grouped")
plot(top10RulesByConfidence, method = "graph", engine = "htmlwidget")
plot(top10RulesByConfidence, method="paracoord")
Customers are buying bottled beer after buying liquor, red/blush wine. Discounts can be given on bottled beer when liquor or red wine is purchased. Placing bottled beer, liquor and red wine together in retail store can help improve sales of these items. In case of an online store bottled beer can be recommended for customers who add liquor or red wine to their cart. Showing the customer as a bundle with tag frequently bought together when one of the items is added similar to amazon website is suggested.
Customers are buying root vegetables after buying fruits, other vegetables, beef, milk and yogurt. Placing root vegetables near to fruits, other vegetables, beef, milk and yogurt is suggested.
Customers are buying tropical fruits after buying ham, other vegetables, pip fruit, citrus fruits, grapes and yogurt. Placing tropical fruits near to ham, other vegetables, pip fruit, citrus fruits, grapes and yogurt is suggested.
Customers are buying yogurt after buying butter, cheese, root vegetables, tropical fruit and whole milk. Placing yogurt near to butter, cheese, root vegetables, tropical fruits and milk is suggested.
Customers are buying whole milk after buying rice, sugar, canned fish, eggs, cheese, butter, hygiene articles, root vegetables, pip fruit and sour cream. Placing whole milk near to rice, sugar, canned fish, eggs, cheese, butter, hygiene articles, root vegetables, pip fruit and sour cream is suggested.
Customers are buying other vegetables after buying citrus fruit, root vegetables and soft cheese. Placing other vegetables near to citrus fruits, root vegetables and soft cheese is suggested.